package com.yskj.mwk.bean;

import lombok.Getter;
import lombok.Setter;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

@Setter
@Getter
public class LogisticsDetail {
    // Getters and Setters
    private String desc;
    private String scanTime;
    private String scanType;

    // 将 scanTime 字符串解析为 LocalDateTime
    public LocalDateTime getScanTimeAsLocalDateTime() {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        return LocalDateTime.parse(scanTime, formatter);
    }

    @Override
    public String toString() {
        return "LogisticsDetail{" +
                "desc='" + desc + '\'' +
                ", scanTime='" + scanTime + '\'' +
                ", scanType='" + scanType + '\'' +
                '}';
    }
}
